<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
          name="viewport">
    <meta content="yes" name="apple-mobile-web-app-capable"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <meta content="telephone=no" name="format-detection"/>
    <meta name="csrf-token" content="cPqshWzq8AP6CPB3WnTjWi7etMHthoseg6rFAYVE">
    <title>换货单</title>
    <meta name="description" content="换货单"/>
    <meta name="Keywords" content="换货单"/>

    {include file="common/link" /}

</head>
<body class="body-1">
<div id="container">
    <div class="mui-content">
        <div class="ny-nav-box">
            <div class="ny-nav line-bot bgcolor-white">
                <div id="segmentedControl" class="mui-segmented-control">
                    <a class="mui-control-item  mui-active" data-state="0" href="#">全部</a>
                    <a class="mui-control-item " data-state="7" href="#">待审核</a>
                    <a class="mui-control-item " data-state="1" href="#">待退货</a>
                    <a class="mui-control-item  " data-state="2" href="#">待发货</a>
<!--                    <a class="mui-control-item class4" href="#item5">待评价</a>-->
                </div>
            </div>
        </div>

    </div>
    <div class="" id="content_area">
        <!--全部-->
        <!--全部-->
        <!--待付款-->
        <div id="item2" class="mui-slider-item mui-control-content class1 mui-active">

            <div class="" data-scroll="2">

                <div class="mui-scroll" data-pulltorefresh="7" style="transform: translate3d(0px, 0px, 0px) translateZ(0px);">
                    <div class="showdata">


                    {volist name="list" id="vo"}
                            <div>
                               <div class="order-item bgcolor-white mt10">
                                   <div class="order-item-t clearfix">
                                       <div class="home-link-box bgcolor-white clearfix">
                                           <a href="#" class="fl">订单编号:<span style="font-size: 12px;color: rgba(104, 111, 140, 0.8);">{$vo.number}</span></a>
<!--                                           <a href="#" class="fl">订单编号:<span style="font-size: 12px;color: rgba(104, 111, 140, 0.8);">{$vo.number}</span></a>-->
<!--                                           <a href="#" class="fl">订单编号:<span style="font-size: 12px;color: rgba(104, 111, 140, 0.8);">{$vo.number}</span></a>-->
                                           <span class="fr color-red" >{$vo.status_txt}</span>
                                       </div>
                                   </div>
                                   <div class="order-item-c line-top line-bot">
                                       <a data-id="488" href="###" class="order-pro-item centerflex"><!---->
                                           <div class="txt box-flex-1">
                                               <h2 class="title" style="font-size: 15px;">{$vo.ccompany}</h2>
                                               <h2 class="title" style="line-height:25px;font-size: 15px;">{$vo.operator}-{$vo.name}</h2>
                                           </div>
                                       </a>
                                   </div>
                                   <div class="order-item-b" style="height: 40px;">
<!--                                       <p class="f0" style="float: left">-->
<!--                                           <span>共<em></em>件</span>-->
<!--                                           <span>合计<em>¥{$vo.actual_cost}</em></span>-->
<!--                                       </p>-->
                                       <p class="f0" style="float: right">
<!--                                           <a data-id="" href="/web/sales/edit?ids={$vo.id}" class="tag tag-grey cancle" {if condition="$vo.status == 1 || $vo.status == 7"} {else /}style="display: none" {/if}>修改</a>-->
                                           <a data-id="" href="/web/change/detail?ids={$vo.id}"  class="tag tag-grey cancle">详情</a>
<!--                                           <a data-id="" href="/web/sales/checkout?ids={$vo.id}"  class="tag tag-red pay" {if condition="$vo.status == 2 || $vo.status == 3"} {else /}style="display: none" {/if}>出库</a>-->
                                       </p>
                                   </div>
                               </div>
                            </div>
                    {/volist}
                    </div>
<!--                    <div class="mui-pull-bottom-tips">-->
<!--                        <div class="mui-pull-bottom-wrapper">-->
<!--                            <span class="mui-pull-loading">没有更多数据了</span>-->
<!--                        </div>-->
<!--                    </div>-->
                    <div class="weui-loadmore">
                        <i class="weui-loading"></i>
                        <span class="weui-loadmore__tips">正在加载</span>
                    </div>
                </div>

                <div class="mui-scrollbar mui-scrollbar-vertical">
                    <div class="mui-scrollbar-indicator" style="transition-duration: 0ms; display: none; height: 688px; transform: translate3d(0px, 0px, 0px) translateZ(0px);">

                    </div>
                </div>
            </div>
        </div>

        <!--待付款-->

        <!--已完成-->
    </div>
    
    
    
    
    
    <!--左侧扇形导航-->
    {include file="common/left-nav" /}
    {include file="common/script" /}
    <!--左侧扇形导航-->
    </div>
    <script>
        page = 1
        pagesize = 10
        status = 0;
        var loading = false;  //状态标记
        var total = "{$total}"
        if(total<pagesize){
            loading = true;
            // $('.weui-loadmore__tips').html('暂无数据')
            $('.weui-loadmore').hide()
        }
        $(document.body).infinite().on("infinite", function() {
            if (loading) return;
            loading = true;
            var total = "{$total}"
            if (total < pagesize) {
                loading = true;
                // $('.weui-loadmore__tips').html('暂无数据')
                $('.weui-loadmore').hide()
                return;
                false;
            }
            ajax()
        })
        $('#segmentedControl').on('click','a',function () {
            status = $(this).data('state')
            page = 0;
            $('.showdata').find('div').remove()
            // $(this).attr('class','mui-control-item  mui-active')
            ajax(1)
        })
        function ajax(type = 0) {
            var url = "{$turl}"+'/web/change/getchange'
            $.post(url,{page:page,pagesize:pagesize,status:status},function (res) {
                loading = false;
                if(res.data.length >0){
                    page++;
                    var str = '';
                    for (var i=0;i<res.data.length;i++){
                        str+='<div>\n' +
                            '                               <div class="order-item bgcolor-white mt10">\n' +
                            '                                   <div class="order-item-t clearfix">\n' +
                            '                                       <div class="home-link-box bgcolor-white clearfix">\n' +
                            '                                           <a href="#" class="fl">订单编号:<span style="font-size: 12px;color: rgba(104, 111, 140, 0.8);">'+res.data[i]['number']+'</span></a>\n' +
                            '                                           <span class="fr color-red" >'+res.data[i]['status_txt']+'</span>\n' +
                            '                                       </div>\n' +
                            '                                   </div>\n' +
                            '                                   <div class="order-item-c line-top line-bot">\n' +
                            '                                       <a data-id="488" href="###" class="order-pro-item centerflex"><!---->\n' +
                            '                                           <div class="txt box-flex-1">\n' +
                            '                                               <h2 class="title" style="font-size: 15px;">'+res.data[i]['ccompany']+'</h2>\n' +
                            '                                               <h2 class="title" style="line-height:25px;font-size: 15px;">'+res.data[i]['operator']+'-'+res.data[i]['name']+'</h2>\n' +
                            '                                           </div>\n' +
                            '                                       </a>\n' +
                            '                                   </div>\n' +
                            '                                   <div class="order-item-b" style="height: 40px;">\n' +
                            // '                                       <p class="f0" style="float: left">\n' +
                            // '                                           <span>共<em>'+res.data[i]['sales_num']+'</em>件</span>\n' +
                            // '                                           <span>合计<em>¥'+res.data[i]['actual_cost']+'</em></span>\n' +
                            // '                                       </p>\n' +
                            '                                       <p class="f0" style="float: right">\n';

                        // if(res.data[i]['status'] == 1 || res.data[i]['status'] ==7 ){
                        //     str += '<a data-id="" href="/web/sales/edit?ids=\'+res.data[i][\'number\']+\'" class="tag tag-grey cancle" >修改</a>';
                        // }
                        str +='<a data-id="" href="/web/change/detail?ids='+res.data[i]['id']+'"  class="tag tag-grey cancle">详情</a>';
                        // if(res.data[i]['status'] == 2 || res.data[i]['status'] ==3 ){
                        //     str +='<a data-id="" href="/web/sales/checkout?ids='+res.data[i]['id']+'"  class="tag tag-red pay">出库</a>';
                        // }
                        str +='                                           \n' +
                            '                                       </p>\n' +
                            '                                   </div>\n' +
                            '                               </div>\n' +
                            '                            </div>'
                    }
                    if(type == 1 && res.data.length <pagesize){
                        $('.weui-loading').hide()
                        $('.weui-loadmore__tips').hide()
                    }
                    $('.showdata').append(str)
                }else{
                    if(type == 1){
                        str = '<div class="mui-content " v-if="!items.length" style="height: 100%">\n' +
                            '                            <div class="shopping_null bgcolor-white" style="height: 100%;padding-bottom:100%;"> <i class="iconfont "></i>\n' +
                            '                                <p>暂无数据！</p>\n' +
                            '                        </div>'
                        $('.showdata').append(str)
                        loading = true;
                        $('.weui-loading').hide()
                        $('.weui-loadmore__tips').hide()
                    }else{
                        loading = true;
                        $('.weui-loadmore__tips').html('已经到底了')
                        $('.weui-loading').hide()
                    }

                    // $('.weui-loadmore_line').attr('style','display:block')
                }
            })
        }
    </script>
</body>
</html>
<!---带扇形 不带footer->
